Repository: opsdroid/opsdroid

Issue:
!include constructor is broken on python 3.6
<!-- Before you post an issue or if you are unsure about something join our gitter channel https://gitter.im/opsdroid/ and ask away! We are more than happy to help you. -->
# Description

After adding pyyaml validation, the `!include` constructor stopped working. I am still unsure if the issue is due to yamale and how it handles nested yaml files.

We need to fix the include constructor so we can keep the functionality of including a yaml file inside another.


## Steps to Reproduce
Add [skill-chat](https://github.com/FabioRosado/skill-chat) to opsdroid
set up skill-chat with a costumised yaml - follow the readme
start opsdroid


## Expected Functionality
Opsdroid should be able to include the custom file inside the configuration


## Experienced Functionality
```
python -m opsdroid start
could not determine a constructor for the tag '!include'
  in "/Users/fabiorosado/Library/Application Support/opsdroid/configuration.yaml", line 130, column 16
```

## Versions
- **Opsdroid version:**
- **Python version:**
- **OS/Docker version:**

## Configuration File
Please include your version of the configuration file bellow.

```yaml
Skills:
  - name: chat
    path: /Users/fabiorosado/Documents/GitHub/skill-chat
    customise: !include customise.yaml

```

## Additional Details
Any other details you wish to include such as screenshots, console messages, etc.


<!-- Love opsdroid? Please consider supporting our collective:
 +👉  https://opencollective.com/opsdroid/donate -->


Discussion:

Resolving patch:
diff --git a/opsdroid/loader.py b/opsdroid/loader.py
--- a/opsdroid/loader.py
+++ b/opsdroid/loader.py
@@ -43,6 +43,11 @@
 class Loader:
     """Class to load in config and modules."""
 
+    try:
+        yaml_loader = yaml.CSafeLoader
+    except AttributeError:
+        yaml_loader = yaml.SafeLoader
+
     def __init__(self, opsdroid):
         """Create object with opsdroid instance."""
         self.opsdroid = opsdroid
@@ -338,7 +343,7 @@ def load_config_file(cls, config_paths):
             config_path = cls.create_default_config(DEFAULT_CONFIG_PATH)
 
         env_var_pattern = re.compile(r"^\$([A-Z_]*)$")
-        yaml.SafeLoader.add_implicit_resolver("!envvar", env_var_pattern, first="$")
+        cls.yaml_loader.add_implicit_resolver("!envvar", env_var_pattern, first="$")
 
         def envvar_constructor(loader, node):
             """Yaml parser for env vars."""
@@ -352,11 +357,10 @@ def include_constructor(loader, node):
             included_yaml = os.path.join(main_yaml_path, loader.construct_scalar(node))
 
             with open(included_yaml, "r") as included:
-                return yaml.safe_load(included)
-
-        yaml.SafeLoader.add_constructor("!envvar", envvar_constructor)
-        yaml.SafeLoader.add_constructor("!include", include_constructor)
+                return yaml.load(included, Loader=cls.yaml_loader)
 
+        cls.yaml_loader.add_constructor("!envvar", envvar_constructor)
+        cls.yaml_loader.add_constructor("!include", include_constructor)
         try:
             with open(config_path, "r") as stream:
                 _LOGGER.info(_("Loaded config from %s."), config_path)
@@ -364,7 +368,7 @@ def include_constructor(loader, node):
                 schema = yamale.make_schema(schema_path)
                 data = yamale.make_data(config_path)
                 yamale.validate(schema, data)
-                return yaml.safe_load(stream)
+                return yaml.load(stream, Loader=cls.yaml_loader)
 
         except ValueError as error:
             _LOGGER.critical(error)


Test patch:
diff --git a/tests/test_loader.py b/tests/test_loader.py
--- a/tests/test_loader.py
+++ b/tests/test_loader.py
@@ -111,7 +111,6 @@ def test_load_exploit(self):
             self.assertRaises(YAMLError)
             unittest.main(exit=False)
 
-    @unittest.skip("old config type fails validation #770")
     def test_load_config_file_with_include(self):
         opsdroid, loader = self.setup()
         config = loader.load_config_file(