From 05e214eb406447196c77c8aa3e4658f70e505f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 10 Aug 2022 11:32:11 +0000 Subject: [PATCH] remove nsec_stat option from tests --- tests/test_git.py | 2 +- tests/test_note_append.py | 2 +- tests/test_usecase.py | 17 +++++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/test_git.py b/tests/test_git.py index d25e6e7..968e63c 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -15,7 +15,7 @@ def git_hash(pubsdir): class TestGitPlugin(sand_env.SandboxedCommandTestCase): - def setUp(self, nsec_stat=True): + def setUp(self): super(TestGitPlugin, self).setUp() # Backup environment variables and set git author self.env_backup = os.environ.copy() diff --git a/tests/test_note_append.py b/tests/test_note_append.py index 32eebee..0d2c3f5 100644 --- a/tests/test_note_append.py +++ b/tests/test_note_append.py @@ -18,7 +18,7 @@ from tests.test_usecase import DataCommandTestCase class TestNoteAppend(DataCommandTestCase): """Test appending a note file from the command-line using the '-a' arg""" - def setUp(self, nsec_stat=True): + def setUp(self): """Initialize a bib entry containing citation key, Page99, for testing""" super(TestNoteAppend, self).setUp() init = ['pubs init', diff --git a/tests/test_usecase.py b/tests/test_usecase.py index 13433d6..257444f 100644 --- a/tests/test_usecase.py +++ b/tests/test_usecase.py @@ -83,9 +83,8 @@ class CommandTestCase(fake_env.TestFakeFs): maxDiff = 1000000 - def setUp(self, nsec_stat=True): + def setUp(self): super(CommandTestCase, self).setUp() - os.stat_float_times(nsec_stat) self.default_pubs_dir = os.path.expanduser('~/.pubs') self.default_conf_path = os.path.expanduser('~/.pubsrc') @@ -179,8 +178,8 @@ class CommandTestCase(fake_env.TestFakeFs): class DataCommandTestCase(CommandTestCase): """Abstract TestCase intializing the fake filesystem and copying fake data.""" - def setUp(self, nsec_stat=True): - super(DataCommandTestCase, self).setUp(nsec_stat=nsec_stat) + def setUp(self): + super(DataCommandTestCase, self).setUp() self.fs.add_real_directory(os.path.join(self.rootpath, 'data'), read_only=False) self.fs.add_real_directory(os.path.join(self.rootpath, 'bibexamples'), read_only=False) # add certificate for web querries @@ -1211,9 +1210,8 @@ class TestCache(DataCommandTestCase): def setUp(self): pass - @ddt.data(True, False) - def test_remove(self, nsec_stat): - DataCommandTestCase.setUp(self, nsec_stat=nsec_stat) + def test_remove(self): + DataCommandTestCase.setUp(self) cmds = ['pubs init', 'pubs add data/pagerank.bib', ('pubs remove Page99', ['y']), @@ -1222,9 +1220,8 @@ class TestCache(DataCommandTestCase): out = self.execute_cmds(cmds) self.assertEqual(1, len(out[3].split('\n'))) - @ddt.data(True, False) - def test_edit(self, nsec_stat): - DataCommandTestCase.setUp(self, nsec_stat=nsec_stat) + def test_edit(self): + DataCommandTestCase.setUp(self) bib = str_fixtures.bibtex_external0 bib1 = re.sub(r'year = \{1999\}', 'year = {2007}', bib)