diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7431c94..6945518 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,4 +37,4 @@ jobs: run: pip install -r requirements.txt - name: Run Python tests - run: python -m unittest discover -p 'test_*.py' -v + run: pytest diff --git a/requirements.txt b/requirements.txt index e69de29..55b033e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1 @@ +pytest \ No newline at end of file diff --git a/src/algorithms/arrays/is-monotonic/__pycache__/test_is_monotonic.cpython-311-pytest-8.2.0.pyc b/src/algorithms/arrays/is-monotonic/__pycache__/test_is_monotonic.cpython-311-pytest-8.2.0.pyc new file mode 100644 index 0000000..e4958db Binary files /dev/null and b/src/algorithms/arrays/is-monotonic/__pycache__/test_is_monotonic.cpython-311-pytest-8.2.0.pyc differ diff --git a/src/algorithms/arrays/is-monotonic/test_is_monotonic.py b/src/algorithms/arrays/is-monotonic/test_is_monotonic.py index a8ebbce..f80d334 100644 --- a/src/algorithms/arrays/is-monotonic/test_is_monotonic.py +++ b/src/algorithms/arrays/is-monotonic/test_is_monotonic.py @@ -1,27 +1,15 @@ -import unittest from is_monotonic import Solution, AnotherSolution -class TestIsMonotonic(unittest.TestCase): +def test_solution_isMonotonic(): + solution = Solution() + assert solution.isMonotonic([1, 2, 2, 3]) + assert solution.isMonotonic([6, 5, 4, 4]) + assert not solution.isMonotonic([1, 3, 2]) - def setUp(self): - self.solution = Solution() - self.another_solution = AnotherSolution() - def test_solution_isMonotonic(self): - self.assertTrue(self.solution.isMonotonic([1, 2, 2, 3])) - - self.assertTrue(self.solution.isMonotonic([6, 5, 4, 4])) - - self.assertFalse(self.solution.isMonotonic([1, 3, 2])) - - def test_another_solution_isMonotonic(self): - self.assertTrue(self.another_solution.isMonotonic([1, 2, 2, 3])) - - self.assertTrue(self.another_solution.isMonotonic([6, 5, 4, 4])) - - self.assertFalse(self.another_solution.isMonotonic([1, 3, 2])) - - -if __name__ == '__main__': - unittest.main() +def test_another_solution_isMonotonic(): + another_solution = AnotherSolution() + assert another_solution.isMonotonic([1, 2, 2, 3]) + assert another_solution.isMonotonic([6, 5, 4, 4]) + assert not another_solution.isMonotonic([1, 3, 2])