question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running repository code locally - AssertionError: assert 'chardet'

See original GitHub issue

Issue description

I’m running the repository code locally. It works and I was able to install the dev dependencies following the contribution guides.

$ python3 -m pipenv --version
pipenv, version 2022.5.3.dev0

When running pytest from withing the active virtual environment I get several erros such as the one below.

$ pytest tests/integration/test_install_basic.py::test_basic_dev_install

...

======================================================================================================= FAILURES =======================================================================================================
________________________________________________________________________________________________ test_basic_dev_install ________________________________________________________________________________________________

PipenvInstance = functools.partial(<class 'tests.integration.conftest._PipenvInstance'>, capfd=<_pytest.capture.CaptureFixture object at 0x7efd4a6c3940>)

    @flaky
    @pytest.mark.dev
    @pytest.mark.run
    def test_basic_dev_install(PipenvInstance):
        with PipenvInstance() as p:
            c = p.pipenv("install requests --dev")
            assert c.returncode == 0
            assert "requests" in p.pipfile["dev-packages"]
            assert "requests" in p.lockfile["develop"]
>           assert "chardet" in p.lockfile["develop"]
E           AssertionError: assert 'chardet' in {'certifi': {'hashes': ['sha256:9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7', 'sha256:f1d53542ee8...256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d'], 'index': 'custom', 'version': '==2.27.1'}, ...}

tests/integration/test_install_basic.py:107: AssertionError

If I comment this specific line the test passes normally, so it seems to be an issue with that particular chardet dependency.

Expected result

I get the feeling this is an issue with my setup but I hope it helps someone.

Assertion arrangements should be expected to work right away from the repository code.

Actual result

Verbose output: https://gist.github.com/epomatti/99e4a43b2e4d22a431045c10a8d9d24c

Steps to replicate

Setup the local development code and run the test suite, such as in this example:

$ pytest tests/integration/test_install_basic.py::test_basic_dev_install

I’m getting an empty output when running pipenv --support from both local installation and the repository code.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
epomatticommented, Jun 17, 2022

@matteius that indeed solved most of my issues.

sudo apt update && sudo apt upgrade -y
sudo apt install build-essential python3-pip python3-venv -y

python3 -m pip install --upgrade pip
sudo pip install virtualenv pipx
pipx install pipenv

git submodule sync
git submodule update --init --recursive
python3 -m pip install -e . --upgrade
pipenv install --deploy --dev

pipenv shell
pylint
0reactions
matteiuscommented, Jun 4, 2022

I re-ran the master CI suite as well to see if there was a recent regression, but there does not appear to be. https://github.com/pypa/pipenv/runs/6736866312?check_suite_focus=true

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python: AssertionError when running nose tests with coverage
I'm fairly green with python testing, so this might be something I'm doing wrong.. When I run my tests, the test runners works...
Read more >
Changelog - pip documentation v22.3.1
Only calculate topological installation order, for packages that are going to be installed/upgraded. This fixes an AssertionError that occurred when determining ...
Read more >
Getting started with Git and AWS CodeCommit
In this step, you push the commit from your local repo to your CodeCommit repository. Run git push to push your commit through...
Read more >
Source Control with Git in Visual Studio Code
To open the Git output window, run View > Output and select Log (Git) from the dropdown list. Initialize a repository. If your...
Read more >
Deploy from local Git repo - Azure App Service - Microsoft Learn
Have a local Git repository with code you want to deploy. To download a sample repository, run the following command in your local...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found