Skip to content

Commit

Permalink
Merge pull request #1358 from hramezani/fix_config_tests
Browse files Browse the repository at this point in the history
Change the config test to remove `NamedTemporaryFile`
  • Loading branch information
yunstanford committed Oct 12, 2018
2 parents 6778f4d + 9a26030 commit 176f8d1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ def test_load_from_missing_envvar(app):


def test_load_config_from_file_invalid_syntax(app):
config = b"VALUE = some value"
with NamedTemporaryFile() as config_file:
config_file.write(config)
config_file.seek(0)
config = "VALUE = some value"
with temp_path() as config_path:
config_path.write_text(config)

with pytest.raises(PyFileError):
app.config.from_pyfile(config_file.name)
app.config.from_pyfile(config_path)


def test_overwrite_exisiting_config(app):
Expand Down

0 comments on commit 176f8d1

Please sign in to comment.