From 9d1b4a9f5df35c52f2b72b85bedea52a318a0259 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 27 May 2023 14:08:32 -0700 Subject: [PATCH] aider: Changed approach to exclude specific test case using `unittest` module. # Context: USER: the -k 'not test_get_tags_map_with_identifiers' seems to have made it skip all the tests ASSISTANT: It seems that the `-k` flag with the `not` expression is not working as expected. Let's change the approach and use the `unittest` module to exclude the specific test case. We'll modify the `python-tests.yml` file to achieve this. ```yaml .github/workflows/python-tests.yml <<<<<<< ORIGINAL - name: Run tests excluding test_get_tags_map_with_identifiers run: | python -m unittest discover -k 'not test_get_tags_map_with_identifiers' ======= - name: Run tests excluding test_get_tags_map_with_identifiers run: | python -c "import unittest; loader = unittest.TestLoader(); suite = loader.discover('.'); suite_filtered = unittest.TestSuite([t for t in suite if 'test_get_tags_map_with_identifiers' not in str(t)]); unittest.TextTestRunner().run(suite_filtered)" >>>>>>> UPDATED ``` This change will discover all tests, filter out the `test_get_tags_map_with_identifiers` test case, and then run the remaining tests. --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 0613fe233..6d8633208 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -31,4 +31,4 @@ jobs: - name: Run tests excluding test_get_tags_map_with_identifiers run: | - python -m unittest discover -k 'not test_get_tags_map_with_identifiers' + python -c "import unittest; loader = unittest.TestLoader(); suite = loader.discover('.'); suite_filtered = unittest.TestSuite([t for t in suite if 'test_get_tags_map_with_identifiers' not in str(t)]); unittest.TextTestRunner().run(suite_filtered)"