From 266c340c77e52d633265f16f9132b664577cef98 Mon Sep 17 00:00:00 2001 From: Moritz Huebner <email@moritz-huebner.de> Date: Tue, 5 Jun 2018 12:46:03 +1000 Subject: [PATCH] Added if __name__ == 'main' clause and removed long tests temporarily from CI --- .gitlab-ci.yml | 6 +++--- test/detector_tests.py | 4 ++++ test/sampler_tests.py | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 085cc2af9..5bf0252d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,9 +29,9 @@ exitcode-jessie: - coverage run --include=tupak/* -a test/waveform_generator_tests.py - coverage html - coverage-badge -o coverage_badge.svg -f - - coverage run --omit=* -a test/example_tests.py - - coverage run --omit=* -a test/noise_realisation_tests.py - - coverage run --omit=* -a test/tests.py +# - coverage run --omit=* -a test/example_tests.py +# - coverage run --omit=* -a test/noise_realisation_tests.py +# - coverage run --omit=* -a test/tests.py # Make the documentation - pip install -r docs/requirements.txt diff --git a/test/detector_tests.py b/test/detector_tests.py index 9818b77d8..5afa72829 100644 --- a/test/detector_tests.py +++ b/test/detector_tests.py @@ -388,3 +388,7 @@ class TestDetector(unittest.TestCase): self.ifo.data = np.array([2]) self.ifo.power_spectral_density.power_spectral_density_interpolated = MagicMock(return_value=np.array([1])) self.assertTrue(np.array_equal(self.ifo.whitened_data, np.array([2]))) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/test/sampler_tests.py b/test/sampler_tests.py index 0135aaaf5..3bdc59fe3 100644 --- a/test/sampler_tests.py +++ b/test/sampler_tests.py @@ -125,4 +125,8 @@ class TestSampler(unittest.TestCase): def test_base_run_sampler(self): sampler_copy = copy.copy(self.sampler) self.sampler._run_external_sampler() - self.assertDictEqual(sampler_copy.__dict__, self.sampler.__dict__) \ No newline at end of file + self.assertDictEqual(sampler_copy.__dict__, self.sampler.__dict__) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file -- GitLab