diff --git a/nose.cfg b/nose.cfg new file mode 100644 index 0000000..e13c638 --- /dev/null +++ b/nose.cfg @@ -0,0 +1,6 @@ +[nosetests] +with-coverage=1 +cover-package=certcheck +cover-erase=1 +cover-html=1 +cover-html-dir=test/output_coverage_html/ diff --git a/test/.coveragerc b/test/.coveragerc deleted file mode 100644 index 4a280d0..0000000 --- a/test/.coveragerc +++ /dev/null @@ -1,27 +0,0 @@ -# .coveragerc to control coverage.py -[run] -branch = True -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: -source = - ../bin/ - ../certcheck/ - - -[html] -directory = output_coverage_html - -[paths] diff --git a/test/test.py b/test/test.py deleted file mode 100755 index 81bab15..0000000 --- a/test/test.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/python -tt -# -*- coding: utf-8 -*- -# Copyright (c) 2013 Spotify AB -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - - -#Make it a bit more like python3: -from __future__ import absolute_import -from __future__ import print_function - -import coverage -import sys -import unittest - - -def main(): - major, minor, micro, releaselevel, serial = sys.version_info - - if major == 2 and minor < 7: - print("In order to run tests you need at least Python 2.7") - sys.exit(1) - - if major == 3: - print("Tests were not tested on Python 3.X, use at your own risk") - sys.exit(1) - - #Perform coverage analisys: - cov = coverage.coverage() - - cov.start() - #Discover the test and execute them: - loader = unittest.TestLoader() - tests = loader.discover('.') - testRunner = unittest.runner.TextTestRunner(descriptions=True, verbosity=1) - testRunner.run(tests) - cov.stop() - - cov.html_report() - -if __name__ == '__main__': - main()