Hi, I think I’ve found a bug in a test case. I mean they’re a bit too complicated for me to understand, but I’m getting a crash and it seems to be a crash in test case for the last exercase in SetsTest.test_singleton_ingredients. To make sure, I’ve restored the function to its original state and it only has pass as the body. Log below:
b0rsuk@dziupla:~/warsztat/cwiczenia/exercism/python/cater-waiter$ uv run pytest -o markers=task
========================================================================= test session starts =========================================================================
platform linux -- Python 3.13.5, pytest-9.1.1, pluggy-1.6.0
rootdir: /home/b0rsuk/warsztat/cwiczenia/exercism/python
configfile: pyproject.toml
collected 7 items
sets_test.py .....F. [100%]
============================================================================== FAILURES ===============================================================================
_________________________________________________________________ SetsTest.test_singleton_ingredients _________________________________________________________________
self = <sets_test.SetsTest testMethod=test_singleton_ingredients>
@pytest.mark.task(taskno=7)
def test_singleton_ingredients(self):
test_data = zip(dishes_and_overlap, singletons)
> for variant, (item, result) in enumerate(test_data, start=1):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sets_test.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
sets_test_data.py:453: in <genexpr>
singletons = (item[0] ^ item[1] for item in zip(ingredients, intersections))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <list_iterator object at 0x7fedf8cc0940>
> ingredients = (set.union(*group) for group in ingredients_only)
^^^^^^^^^^^^^^^^^
E TypeError: unbound method set.union() needs an argument
sets_test_data.py:452: TypeError
======================================================================= short test summary info =======================================================================
FAILED sets_test.py::SetsTest::test_singleton_ingredients - TypeError: unbound method set.union() needs an argument
===================================================================== 1 failed, 6 passed in 0.05s =====================================================================
I thought maybe this fancy new tool I’m using, uv, was interfering with tests and tried running them the old way:
b0rsuk@dziupla:~/warsztat/cwiczenia/exercism/python/cater-waiter$ dpkg -l | grep python3-pytest
ii python3-pytest 8.3.5-2 all Simple, powerful testing in Python3
(Yes, I just installed the package and I’m using Debian Linux 13/Trixie)
b0rsuk@dziupla:~/warsztat/cwiczenia/exercism/python/cater-waiter$ python3 --version
Python 3.13.5
But running tests without uv doesn’t help:
b0rsuk@dziupla:~/warsztat/cwiczenia/exercism/python/cater-waiter$ python3 -m pytest -o markers=task
========================================================================= test session starts =========================================================================
platform linux -- Python 3.13.5, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/b0rsuk/warsztat/cwiczenia/exercism/python
configfile: pyproject.toml
plugins: typeguard-4.4.2
collected 7 items
sets_test.py .....F. [100%]
============================================================================== FAILURES ===============================================================================
_________________________________________________________________ SetsTest.test_singleton_ingredients _________________________________________________________________
self = <sets_test.SetsTest testMethod=test_singleton_ingredients>
@pytest.mark.task(taskno=7)
def test_singleton_ingredients(self):
test_data = zip(dishes_and_overlap, singletons)
> for variant, (item, result) in enumerate(test_data, start=1):
sets_test.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
sets_test_data.py:453: in <genexpr>
singletons = (item[0] ^ item[1] for item in zip(ingredients, intersections))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <list_iterator object at 0x7f68ce4013c0>
> ingredients = (set.union(*group) for group in ingredients_only)
E TypeError: unbound method set.union() needs an argument
sets_test_data.py:452: TypeError
======================================================================= short test summary info =======================================================================
FAILED sets_test.py::SetsTest::test_singleton_ingredients - TypeError: unbound method set.union() needs an argument
===================================================================== 1 failed, 6 passed in 0.06s ====================================================================
To make it easier for you, I’ve just submitted my partial, unfinished program. The last solution (for singleton_ingredients) is currently commented out.