diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05681e9769384b5beae2654d62b5e46a7b90e996..8f6f26973c1c0d23f4dda55da058543d2c9dfe36 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,16 @@ -run_tests: - stage: test - image: python:3.9 - before_script: - - pip install -r requirements.txt - script: - - python -m unittest discover tests +image: "python:3.7" + +before_script: + - python --version + - pip install -r requirements.txt + +stages: + - Static Analysis + - Test + +... + +pytest: + stage: Test + script: + - pytest diff --git a/tests/test_router.py b/tests/test_router.py index 9ecd3d818577c0d382d135fd2d558cf8931a54e8..54cfba9f8c87992084a5ea06bbe1a3a578b1fb92 100644 --- a/tests/test_router.py +++ b/tests/test_router.py @@ -1,15 +1,14 @@ -import unittest +def test_uppercase(): + assert "loud noises".upper() == "LOUD NOISES" -class TestSum(unittest.TestCase): - def test_list_int(self): - """ - Test that it can sum a list of integers - """ - data = [1, 2, 3] - result = sum(data) - self.assertEqual(result, 6) +def test_reversed(): + assert list(reversed([1, 2, 3, 4])) == [4, 3, 2, 1] -if __name__ == '__main__': - unittest.main() +def test_some_primes(): + assert 37 in { + num + for num in range(2, 50) + if not any(num % div == 0 for div in range(2, num)) + } \ No newline at end of file