diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89884ed..99574e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: types: [opened, synchronize, reopened] jobs: - test: + jest-tests: name: Run Jest tests runs-on: ubuntu-latest @@ -18,3 +18,23 @@ jobs: - name: Run Jest tests run: npm test -- --coverage --ci + + python-tests: + name: Run Python tests + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run Python tests + run: pytest \ No newline at end of file diff --git a/src/algorithms/arrays/is-monotonic/test_is_monotonic.py b/src/algorithms/arrays/is-monotonic/test_is_monotonic.py index d5d861a..f80d334 100644 --- a/src/algorithms/arrays/is-monotonic/test_is_monotonic.py +++ b/src/algorithms/arrays/is-monotonic/test_is_monotonic.py @@ -1,19 +1,15 @@ -import unittest -from is_monotonic import Solution +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() - def test_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])) - - -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])