Skip to content

Conversation

@Gogo-ug1
Copy link
Collaborator

Closes #93

image

@Gogo-ug1
Copy link
Collaborator Author

The test cases are failing but they work on my local after I downgraded the pytest library.
Requesting for guidance.

@aaronjae22
Copy link
Collaborator

I am taking a look at it. I'll inform you

@alexbainter
Copy link
Collaborator

Tests passed for me locally with the following versions:

Python 3.11.13, pytest-8.3.5, pluggy-1.5.0
django: version: 4.2.4
plugins: Faker-37.1.0, django-4.7.0, base-url-2.1.0, playwright-0.4.4, factoryboy-2.5.1
collected 14 items / 1 deselected / 13 selected

@lisad
Copy link
Member

lisad commented Jul 21, 2025

Looking at the CI/CD failure stack trace, it's failing specifically in a line calling @register, which is a factoryboy decorator. That suggests a couple avenues for investigation:

  • Is this changed or deprecated? if it has changed, should we be using the decorator differently?
  • Should we be using the decorator at all? What do we get out of it and why was it added? (we can see what else was added in the same pull request)
  • Is the factoryboy library version compatible with the pytest version? Should the factoryboy library be pinned to a different version in requirements.txt?
  • Looking in more detail at the installation log from Github's CI/CD, it looks like an 8.4 version of pytest is being installed to satisfy the requirement of pytest-factoryboy of having pytest version at least 5.0.0 or more recent. However this clearly isn't working at version 8.4 of pytest so one of the best kinds of fixes for these version discrepancies is to update libraries to more modern versions. (Just staying with older versions is a bad practice because older versions of software can have security flaws). One way to test this is to make sure your local version of pytest is 8.4.x and reproduce the test failure, then start to play with versions of pytest-factoryboy and factoryboy that are more recent than 2.5.1 and see if the test failure goes away.

Also because Gogo was able to reproduce the failure with one version of pytest, and then make the failure go away with another version of pytest, it's possible we could address it that way. It looks like pytest is not itself listed in requirements.txt. (Only the pytest-django package is, which contains some utilities for working with pytest and django).

  • We could look at the CI/CD setup and find out where it is defining the version of python. Does it install pytest early before looking at requirements.txt? Is that specifying a version of pytest that doesn't work?
  • Or, is it the case that CI/CD is installing pytest implicitly as a part of installing pytest-django? Could we pin a specific version of pytest in requirements.txt?
    To find out when pytest is being installed, it might be worth a close read of the CI/CD setup logs, long before it starts running tests.

@aaronjae22
Copy link
Collaborator

I was able to replicate the issue. Currently working with Gogo on a solution.
image

Copy link
Member

@lisad lisad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to merge this when the package version branch is merged in and tests pass

@Gogo-ug1 Gogo-ug1 merged commit 5b8b4ae into main Jul 25, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve styling of article list page

5 participants