pytest pep8 compliance check gets stuck

I want to test some simple code for pep8 compliance using pytest pep8 in Ubuntu 18.04. The command I use in the terminal is [email protected]_name's-laptop:~/my_folder$ py.test --pep8...

Pytest-pep8 problem while following Head First Python 2nd edition

I've been following Head First Python 2nd Edition and in chapter 4, a pep8 compliance testing is demonstrated. Despite having the same code as in book, my output is different. Tested code is quite...

How to debug py.test in PyCharm when coverage is enabled

How do I debug py.test in PyCharm when coverage is enabled? Coverage is enabled using --cov=project --cov-report=term-missing, removing this and breakpoints are hit. Versions: pycharm 5.0.3,...

Pytest won't run any tests

I couldn't get pytest to run tests on Python 3.6, so I uninstalled and reinstalled Python 3.7. Then I downloaded pytest and pep8 using pip and added...

PEP8 mark the variable reference @pytest.fixture as "shadows name from outer scope"

I have one simple pytest problem,: import pytest @pytest.fixture def config(): return "abc" def mytest(config): print(config) The message mentioned that "Shadows name 'config'...

pep8 compliance testing is failing

I've followed Head First Python 2nd Edition and a pep8 compliance testing is demonstrated in chapter 4. When running py.test --pep8 searchV.py gives...

'py.test' is not recognized as an internal or external command, operable program or batch file

I started learning python recently and I know my problem may not be sth complicated. I issued below command from my Windows cmd to install pytest framework and its required dependencies py -3 -m...

Violations plugin uses wrong path to find pep8 report

I'm using pytest to run pep8 check (all of the listed below is happening on a windows machine): py.test --pep8 --junitxml=reports\pep8.log I setup a job to look for pep8.log file in...

PEP8-conform coding style when importing text fixtures (F401 + F811)

Sometimes I use a pytest fixture defined in another module (probably because I want to re-use it in multiple places). As a minimal artificial example, the structure would be something like...

Setuptools "development" Requirements

TL;DR: Is there a way to hook setuptool's 'develop' to install a set of development requirements when running python setup.py develop? I'm building my first python package using setuptools. I'm...

Can py.test test docstring for the numpy style?

My pytest.ini currently looks like this: [pytest] addopts = --doctest-modules --cov=. --cov-report html --pep8 --flakes doctest_encoding = utf-8 So I already test for PEP8. But I would also like...

pytest-cov not working with tox

This is my tox.ini configuration <!-- language: lang-ini --> [tox] envlist = py36 [testenv] commands = pytest -vv --pep8 --flakes \ --cov=quest --cov-report \ term-missing...

Is it possible to run tox directly in a Jenkinsfile?

I have a python project, locally I have setup tox to automate pep8, bandit scans, pytest etc... Now I 'm asked to move to existing CICD and they have given me a Jenkins file. I need to add these...

KeyError while trying to run Selenium-pytest in Docker Container

I am trying to run pytest Test Framework with Docker. However I am encountering the below error while running the...

How to run py.test and linters in `python setup.py test`

I have a project with a setup.py file. I use pytest as the testing framework and I also run various linters on my code (pep8, pylint, pydocstyle, pyflakes, etc). I use tox to run these in several...

Moved from pip to poetry and now pytest-cov won't collect coverage data

I recently started using poetry to manage project dependencies, rather than using requirements.txt and test-requirements.txt and pip. Since making the change, I'm not able to get coverage tests to...

Jenkins send me the error: ImportError: Import by filename is not supported

My problem is this: I am trying to integrate jenkins with my python project, where I have already been able to configure some things like pep8 and pylint, but I am now trying the tests through...

Why isn't "is" comparison used in place of "==" for primitive types?

When I'm using Pytest for Python formatting, it complains about doing something like: &gt;&gt;&gt; assert some_function_ret_val() == True E712 comparison to True should be &#39;if cond is...

"file not found" on travis-ci when running pytest from tox using docker

I'm trying to run my tests throught travis-ci, but i receive "file not found tests" error. When i run local with same command everything is ok, but in travis i receive this error. I think its...

How do I run a command on all files from git ls-files?

We have a CI script that does style checking on all Python files in the repository like this: #!/usr/bin/env bash find . -name \*.py -exec pep8 --ignore=E402 --max-line-length=120 {} + if [ $? -ne...

Add pytests to my project using setuptools

I'm trying to execute tests defined in test_csconfig.py from the following dir structure: ```` tree . . ├── CMakeLists.txt ├── healthcheck.conf ├── pki │   ├── pycache │   │   └──...

Python setuptools integration with pip, setup_require vs pip install

I have setup.py and requirements.txt files, at the req file i put all the packages i need for my package and i'm using it at the install_requires=read_from_file() option. Now i have 2 more options...

Snippets vs. Abbreviations in Vim

What advantages and/or disadvantages are there to using a "snippets" plugin, e.g. snipmate, ultisnips, for VIM as opposed to simply using the builtin "abbreviations" functionality? Are there...

Configure REDIS in Gitlab CI/CD for usage in Django

I had a working pipeline on GitLab which started failing after I added tests involving REDIS. I've applied (?) what is written inside GitLab docs but still REDIS is not discovered by my tests....

Format or Simplify a Long Boolean Expression in Python?

I'm looking for some ideas to keep the following Python function as readable as possible. The function is from a pytest conftest.py file. It finds filename pairs in a directory and, where...

Trying to run vpython code in Anaconda IDE, error with "visual" module

I am using on windows 7 64 bit the Anaconda IDE for Python 2.7. I need to start using Vpython so I installed it from the official site of Anaconda https://www.continuum.io/downloads . Whenever I...

Python click project, "Django is not available on the PYTHONPATH " error

I am having a click project which don't use/need Django anywhere but while running prospector as part of static analysis throws this strange error Command prospector -I __init__.py --strictness...

Debugger output not shown

I am running into a problem while running ipdb within a test containing the capfd fixture. A cut down version of the test code is as thus: import pytest import sys def test_foo(capfd): def...

Permission Denied docker Mac Os M1

I'm extremely new to docker and I keep running into "permission denied" issues. I was able to build an image using the following docker file: FROM tensorflow/tensorflow:latest ENV...