From f4112a758ac00cd25b744227e84ffdd076d07ca5 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Wed, 18 May 2016 22:18:10 +0200 Subject: [PATCH] simplify test --- autocmake/parse_yaml.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/autocmake/parse_yaml.py b/autocmake/parse_yaml.py index 447d16d..c613364 100644 --- a/autocmake/parse_yaml.py +++ b/autocmake/parse_yaml.py @@ -18,20 +18,8 @@ def parse_yaml(stream, override={}): def test_parse_yaml(): - import tempfile - import os - text = """foo: bar this: that var: '%(foo)'""" - # we save this text to a temporary file - file_name = tempfile.mkstemp()[1] - with open(file_name, 'w') as f: - f.write(text) - - with open(file_name, 'r') as f: - assert parse_yaml(f) == {'foo': 'bar', 'this': 'that', 'var': 'bar'} - - # we remove the temporary file - os.unlink(file_name) + assert parse_yaml(text) == {'foo': 'bar', 'this': 'that', 'var': 'bar'}