Skip to content

Commit

Permalink
Merge pull request #2 from fispact/move_tests
Browse files Browse the repository at this point in the history
Moved tests out of package and fixes to pypi setup.
  • Loading branch information
thomasms authored Feb 28, 2018
2 parents d8f3e4b + 4f8a26d commit d84d17e
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[run]
omit = pypact/tests/*
omit = tests/*
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ before_script:
script:
- pip3 install -e $PYPACT
- python $PYPACT/setup.py test
- coverage run $PYPACT/pypact/tests/testsuite.py
- coverage run $PYPACT/tests/testsuite.py
- pylint -j4 $PYPACT/pypact --rcfile=$PYPACT/.pylintrc || true
- fispactconverter.py $PYPACT/reference/test31.out test31.json
# - diff test31.json $PYPACT/reference/test31.json
Expand Down
18 changes: 0 additions & 18 deletions pypact/tests/testsuite.py

This file was deleted.

2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[pytest]
addopts = --cov-config .coveragerc --cov=./pypact
python_files = pypact/tests/testsuite.py
python_files = tests/testsuite.py
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@


setup(name='pypact',
version='1.1.0',
version='1.1.1',
description='The package for reading and manipulating the fispact output text file.',
url='https://github.com/fispact/pypact',
author='UKAEA',
author_email='[email protected]',
license='Apache License 2.0',
packages=[
'pypact'
'pypact',
'pypact.analysis',
'pypact.library',
'pypact.output',
'pypact.tools',
'pypact.util'
],
install_requires=[],
python_requires='>=3',
scripts=['pypact/tools/fispactconverter.py'],
setup_requires=['pytest-runner'],
test_suite='pypact.tests.testsuite',
test_suite='tests.testsuite',
tests_require=['pytest'],
zip_safe=False)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from pypact.filerecord import FileRecord
from pypact.tests.testerbase import Tester, REFERENCE_DIR
from tests.testerbase import Tester, REFERENCE_DIR


class BaseOutputUnitTest(Tester):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import math

from tests.output.baseoutputtest import BaseOutputUnitTest

from pypact.util.numerical import nan
from pypact.filerecord import FileRecord
from pypact.tests.output.baseoutputtest import BaseOutputUnitTest
from pypact.output.doserate import DoseRate


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pypact.tests.output.baseoutputtest import BaseOutputUnitTest
from tests.output.baseoutputtest import BaseOutputUnitTest

from pypact.output.nuclides import Nuclides
from pypact.output.nuclide import Nuclide

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pypact.tests.output.baseoutputtest import BaseOutputUnitTest
from pypact.tests.output.rundatatest import RunDataAssertor
from pypact.tests.output.timesteptest import TimeStepAssertor
from tests.output.baseoutputtest import BaseOutputUnitTest
from tests.output.rundatatest import RunDataAssertor
from tests.output.timesteptest import TimeStepAssertor

from pypact.output.output import Output


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pypact.tests.output.baseoutputtest import BaseOutputUnitTest
from tests.output.baseoutputtest import BaseOutputUnitTest

from pypact.output.rundata import RunData


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pypact.tests.output.baseoutputtest import BaseOutputUnitTest
from pypact.tests.output.doseratetest import DoseRateAssertor
from pypact.tests.output.nuclidestest import NuclidesAssertor
from tests.output.baseoutputtest import BaseOutputUnitTest
from tests.output.doseratetest import DoseRateAssertor
from tests.output.nuclidestest import NuclidesAssertor

from pypact.output.timestep import TimeStep


Expand Down
2 changes: 1 addition & 1 deletion pypact/tests/testerbase.py → tests/testerbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

REFERENCE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'..', '..', 'reference')
'..', 'reference')

class Tester(unittest.TestCase):

Expand Down
18 changes: 18 additions & 0 deletions tests/testsuite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest

from tests.util.filetest import FileUnitTest
from tests.util.linestest import LinesUnitTest
from tests.util.numericaltest import NumericalUnitTest
from tests.util.propertyfindertest import PropertyFinderUnitTest
from tests.output.doseratetest import DoseRateUnitTest
from tests.output.rundatatest import RunDataUnitTest
from tests.output.nuclidestest import NuclidesUnitTest
from tests.output.timesteptest import TimeStepUnitTest
from tests.output.outputtest import OutputUnitTest

def main():
unittest.TextTestRunner(verbosity=3).run(unittest.TestSuite())


if __name__ == '__main__':
unittest.main()
File renamed without changes.
4 changes: 3 additions & 1 deletion pypact/tests/util/filetest.py → tests/util/filetest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import unittest
import os
from pypact.tests.testerbase import REFERENCE_DIR

from tests.testerbase import REFERENCE_DIR

from pypact.util.file import *


Expand Down
4 changes: 3 additions & 1 deletion pypact/tests/util/linestest.py → tests/util/linestest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os
from pypact.tests.testerbase import Tester, REFERENCE_DIR

from tests.testerbase import Tester, REFERENCE_DIR

import pypact.util.lines as lines
from pypact.util.file import content_as_str

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os
from pypact.tests.testerbase import Tester, REFERENCE_DIR

from tests.testerbase import Tester, REFERENCE_DIR

import pypact.util.propertyfinder as pf
from pypact.util.file import content_as_str

Expand Down
6 changes: 6 additions & 0 deletions update_on_pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

python3 setup.py test
python3 setup.py sdist
python3 setup.py bdist_wheel
twine upload dist/*

0 comments on commit d84d17e

Please sign in to comment.