FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

running `doctest` failes by d-chris · Pull Request #417 · python-validators/validators · GitHub

Repository navigation

running doctest failes - #417

Merged
nandgator merged 9 commits into
python-validators:masterfrom
d-chris:d-chris/issue416
Apr 26, 2025
Merged

nandgator merged 9 commits into
python-validators:masterfrom
d-chris:d-chris/issue416

Conversation

d-chris commented Mar 18, 2025

Copy link
Copy Markdown
Contributor

Fixes #416

using pytest-doctestplus to resolve the issue

Copy link
Copy Markdown
Collaborator

Thanks! Can you add it to the testing group, with any configurations in the pyproject.toml file?

nandgator added waiting Issue/PR: Wating for reply documentation Issue/PR: Any changes in documentation labels Mar 29, 2025

d-chris commented Mar 29, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

@yozachar your wish is my command 8ddc7fb

running pytest will check now also examples in the docstrings.

Comment thread pyproject.toml Outdated

nandgator commented Mar 29, 2025 •
edited
Loading

Copy link
Copy Markdown
Collaborator
============================================================================ ERRORS =============================================================================
_________________________________________________________________ ERROR collecting site/conf.py _________________________________________________________________
import file mismatch:
imported module 'conf' has this __file__ attribute:
  ~/validators/docs/conf.py
which is not the same as the test file we want to collect:
  ~/validators/site/conf.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
==================================================================== short test summary info ====================================================================
ERROR site/conf.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 1 error in 0.73s ========================================================================

Shouldn't the package be installed?


pdm add -G testing pytest-doctestplus

Still throws the same error.

d-chris commented Mar 29, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

@yozachar i did not change any dependencies nor requirements.

  • i basically changed only the docstrings.
  • the command pytest --doctest-modules does not require another 3rd party package.

to your error message try to delete __pycache__

git clean -dx --dry-run

Copy link
Copy Markdown
Collaborator

Why is it attempting to import docs/conf.py?

d-chris commented Mar 29, 2025

Copy link
Copy Markdown
Contributor Author

Why is it attempting to import docs/conf.py?

maybe you want to revert my toml File Change?

Copy link
Copy Markdown
Collaborator

Why is it attempting to import docs/conf.py?

maybe you want to revert my toml File Change?

I do not see how 3529dcd is related to https://github.com/python-validators/validators/actions/runs/14146186209/job/39633755493?pr=417#step:5:20

d-chris commented Mar 29, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

@yozachar me neither, i specified now testpath in the toml file

run tox locally on windows 10, passed except linting

lint: exit 1 (2.00 seconds) F:\github\validators> ruff check . pid=17048
format: OK ✔ in 28.53 seconds
py311: OK ✔ in 29.52 seconds
sast: OK ✔ in 30.1 seconds
py38: OK ✔ in 30.59 seconds
type: OK ✔ in 32.57 seconds
py39: OK ✔ in 35.76 seconds
py310: OK ✔ in 35.86 seconds
  lint: FAIL code 1 (26.62=setup[24.62]+cmd[2.00] seconds)
  type: OK (32.57=setup[24.47]+cmd[8.10] seconds)
  format: OK (28.52=setup[24.54]+cmd[3.98] seconds)
  sast: OK (30.10=setup[24.75]+cmd[5.35] seconds)
  py38: OK (30.59=setup[24.42]+cmd[6.17] seconds)
  py39: OK (35.76=setup[28.92]+cmd[6.85] seconds)
  py310: OK (35.86=setup[29.18]+cmd[6.68] seconds)
  py311: OK (29.52=setup[24.29]+cmd[5.23] seconds)
  py312: OK (36.04=setup[30.13]+cmd[5.91] seconds)
  evaluation failed :( (37.27 seconds)
warning: Invalid `# noqa` directive on src\validators\crypto_addresses\eth_address.py:52: expected code to consist of uppercase letters followed by digits only (e.g. `F401`)
warning: Invalid `# noqa` directive on src\validators\crypto_addresses\bsc_address.py:29: expected code to consist of uppercase letters followed by digits only (e.g. `F401`)

Copy link
Copy Markdown
Collaborator

This is odd. Locally, tox is all green. Anything amiss here: https://github.com/python-validators/validators/blob/master/.github/workflows/pycqa.yaml ?

d-chris commented Mar 29, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

mh don't see any obvious.

due the nature of your package i used pdm in the CI to set everything up.

all green... https://github.com/d-chris/validators/actions/runs/14147791659

@yozachar maybe --doctest-modules requires the package itself to be installed?
add in your action pip install . after you install the requirements?

nandgator removed the waiting Issue/PR: Wating for reply label Apr 3, 2025

Copy link
Copy Markdown
Collaborator

Thanks @d-chris!

nandgator merged commit b2510d1 into python-validators:master Apr 26, 2025
d-chris deleted the d-chris/issue416 branch April 26, 2025 18:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Issue/PR: Any changes in documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

running doctest failes

2 participants


Back | FazBrowse Home | New Git URL