Merge pull request #1358 from hramezani/fix_config_tests

Change the config test to remove `NamedTemporaryFile`
This commit is contained in:
7 2018-10-11 21:39:48 -07:00 committed by GitHub
commit 176f8d1981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,13 +89,12 @@ def test_load_from_missing_envvar(app):
def test_load_config_from_file_invalid_syntax(app): def test_load_config_from_file_invalid_syntax(app):
config = b"VALUE = some value" config = "VALUE = some value"
with NamedTemporaryFile() as config_file: with temp_path() as config_path:
config_file.write(config) config_path.write_text(config)
config_file.seek(0)
with pytest.raises(PyFileError): with pytest.raises(PyFileError):
app.config.from_pyfile(config_file.name) app.config.from_pyfile(config_path)
def test_overwrite_exisiting_config(app): def test_overwrite_exisiting_config(app):