Path 1: 3 calls (0.6)

'FOO_SETTINGS' (3)

False (2) True (1)

True (1) None (1) False (1)

FileNotFoundError (1)

1def from_envvar(self, variable_name: str, silent: bool = False) -> bool:
2        """Loads a configuration from an environment variable pointing to
3        a configuration file.  This is basically just a shortcut with nicer
4        error messages for this line of code::
5
6            app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS'])
7
8        :param variable_name: name of the environment variable
9        :param silent: set to ``True`` if you want silent failure for missing
10                       files.
11        :return: ``True`` if the file was loaded successfully.
12        """
13        rv = os.environ.get(variable_name)
14        if not rv:
15            if silent:
16                return False
17            raise RuntimeError(
18                f"The environment variable {variable_name!r} is not set"
19                " and as such configuration could not be loaded. Set"
20                " this variable and make it point to a configuration"
21                " file"
22            )
23        return self.from_pyfile(rv, silent=silent)
            

Path 2: 1 calls (0.2)

'FOO_SETTINGS' (1)

False (1)

RuntimeError (1)

1def from_envvar(self, variable_name: str, silent: bool = False) -> bool:
2        """Loads a configuration from an environment variable pointing to
3        a configuration file.  This is basically just a shortcut with nicer
4        error messages for this line of code::
5
6            app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS'])
7
8        :param variable_name: name of the environment variable
9        :param silent: set to ``True`` if you want silent failure for missing
10                       files.
11        :return: ``True`` if the file was loaded successfully.
12        """
13        rv = os.environ.get(variable_name)
14        if not rv:
15            if silent:
16                return False
17            raise RuntimeError(
18                f"The environment variable {variable_name!r} is not set"
19                " and as such configuration could not be loaded. Set"
20                " this variable and make it point to a configuration"
21                " file"
22            )
23        return self.from_pyfile(rv, silent=silent)
            

Path 3: 1 calls (0.2)

'FOO_SETTINGS' (1)

True (1)

False (1)

1def from_envvar(self, variable_name: str, silent: bool = False) -> bool:
2        """Loads a configuration from an environment variable pointing to
3        a configuration file.  This is basically just a shortcut with nicer
4        error messages for this line of code::
5
6            app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS'])
7
8        :param variable_name: name of the environment variable
9        :param silent: set to ``True`` if you want silent failure for missing
10                       files.
11        :return: ``True`` if the file was loaded successfully.
12        """
13        rv = os.environ.get(variable_name)
14        if not rv:
15            if silent:
16                return False
17            raise RuntimeError(
18                f"The environment variable {variable_name!r} is not set"
19                " and as such configuration could not be loaded. Set"
20                " this variable and make it point to a configuration"
21                " file"
22            )
23        return self.from_pyfile(rv, silent=silent)