1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-23 00:29:59 +02:00

test optimizations

This commit is contained in:
Kelly Brazil
2022-09-23 16:30:43 -07:00
parent ae9c1746f1
commit 45fae976f0
3 changed files with 12 additions and 15 deletions

View File

@ -20,11 +20,10 @@ class MyTests(unittest.TestCase):
} }
for file, filepaths in fixtures.items(): for file, filepaths in fixtures.items():
with open(os.path.join(THIS_DIR, filepaths[0]), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, filepaths[0]), 'r', encoding='utf-8') as a, \
cls.f_in[file] = f.read() open(os.path.join(THIS_DIR, filepaths[1]), 'r', encoding='utf-8') as b:
cls.f_in[file] = a.read()
with open(os.path.join(THIS_DIR, filepaths[1]), 'r', encoding='utf-8') as f: cls.f_json[file] = json.loads(b.read())
cls.f_json[file] = json.loads(f.read())
def test_foo_nodata(self): def test_foo_nodata(self):

View File

@ -23,11 +23,10 @@ class MyTests(unittest.TestCase):
} }
for file, filepaths in fixtures.items(): for file, filepaths in fixtures.items():
with open(os.path.join(THIS_DIR, filepaths[0]), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, filepaths[0]), 'r', encoding='utf-8') as a, \
cls.f_in[file] = f.read() open(os.path.join(THIS_DIR, filepaths[1]), 'r', encoding='utf-8') as b:
cls.f_in[file] = a.read()
with open(os.path.join(THIS_DIR, filepaths[1]), 'r', encoding='utf-8') as f: cls.f_json[file] = json.loads(b.read())
cls.f_json[file] = json.loads(f.read())
def test_foo_s_nodata(self): def test_foo_s_nodata(self):

View File

@ -20,11 +20,10 @@ class MyTests(unittest.TestCase):
} }
for file, filepaths in fixtures.items(): for file, filepaths in fixtures.items():
with open(os.path.join(THIS_DIR, filepaths[0]), 'r', encoding='utf-8') as f: with open(os.path.join(THIS_DIR, filepaths[0]), 'r', encoding='utf-8') as a, \
cls.f_in[file] = f.read() open(os.path.join(THIS_DIR, filepaths[1]), 'r', encoding='utf-8') as b:
cls.f_in[file] = a.read()
with open(os.path.join(THIS_DIR, filepaths[1]), 'r', encoding='utf-8') as f: cls.f_json[file] = json.loads(b.read())
cls.f_json[file] = json.loads(f.read())
def test_proc_buddyinfo_nodata(self): def test_proc_buddyinfo_nodata(self):