Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Filter by
Sorted by
Tagged with
2 votes
1 answer
518 views

I have a simple method that receives a list of trades (descriptions and ids) and return the id of selected ones. If none is selected, you are asked to confirm that. I used python-inquirer to do that: ...
staticdev's user avatar
  • 3,080
2 votes
0 answers
410 views

When I run the command coverage report -m after running coverage run main.py any of the lines in the methods that I have test are covered, I using a context.py file and I have the following project ...
RdTek's user avatar
  • 121
2 votes
0 answers
709 views

My goal is to reach 100% coverage on unit tests I'm writing (Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32) The code I'm testing has exit ...
user2723494's user avatar
  • 1,228
2 votes
0 answers
694 views

I have a Python application I'm running within a Docker container. That application is normally started with the command /usr/local/bin/foo_service, which is a Python entry point (so it's just a ...
Nick Williams's user avatar
2 votes
1 answer
1k views

I am working on an enormous django project that takes hours to generate a coverage report (using the coverage.py library). Instead, I want travis to generate a report on only the functions that have ...
Preethi Vaidyanathan's user avatar
2 votes
2 answers
506 views

I am currently developing some tests using python py.test / unittest that, via subprocess, invoke another python application (so that I can exercise the command line options, and confirm that the tool ...
user1933950's user avatar
2 votes
0 answers
629 views

The nosetests tool for Python testing has an option --cover-inclusive to include all files to be able to discover holes in testing (see documentation). However, it does not seem to work properly: it ...
CNugteren's user avatar
  • 890
2 votes
2 answers
119 views

The question comes from this scenario: We've built a framework to test northbound apis of our project, based on pytest. And now we want to have a coverage report about how many apis are tested(...
Li Feng's user avatar
  • 1,021
2 votes
0 answers
177 views

I've got tests to cover 100% of my Python code. Beside it my code fails on TypeError in mako template. Is it any way to make pycharm's coverage show code coverage in templates too?
Djent's user avatar
  • 3,509
2 votes
0 answers
1k views

In my project I have the following structure of files: .. file1.py file2.py tests/ test1.py test2.py I have installed nosetests and coverage and I run tests with the following command (...
GriMel's user avatar
  • 2,330
2 votes
0 answers
252 views

I'm configuring reports in Jenkins and nosetests --with-xcoverage gives me XML with an empty name attribute: <packages> <package branch-rate="0" complexity="0" line-rate="0.282" name=""&...
ambertch's user avatar
  • 7,659
2 votes
1 answer
971 views

I'm trying to debug my tests and I am using a custom testrunner. I am able to get pdb to function just fine when I am not using it in conjunction with manage.py. in mysite/blog/tests/models_tests.py ...
Jon Poler's user avatar
  • 183
1 vote
1 answer
2k views

I am using pytest coverage and following I have the tests scripts in the command line that will generate the coverage reports for me: """Manager script to run the commands on the Flask ...
Amirsalar's user avatar
  • 739
1 vote
2 answers
2k views

this code is saved with calc.py. This is a basic calculator program in which I have used flask module. def sum(number1,number2): result= number1+number2 return result def sub(number1,number2):...
RITIK KUMAR's user avatar
1 vote
1 answer
3k views

I am using pytest framework and pytest-cov plugin to get the coverage report generated, which generates a coverage report file inside htmlcov directory after the test cases are executed, is there a ...
Junior's user avatar
  • 13
1 vote
3 answers
4k views

I have a python program that imports other files which potentially import other files, as is normal with python development The problem is, when I measure coverage with coverage.py, some files which ...
yigal's user avatar
  • 4,925
1 vote
1 answer
1k views

I am trying to get test coverage report and unit test details (number of test cases, # of passed test cases) into sonar. I have generated report using coverage and nosetests plugin and stored same ...
Deepesh Jain's user avatar
1 vote
1 answer
1k views

I'm writing coverage test cases for my app views. I have used Createview and Updateview classes with modelform and also used get_success_url() for response redirect. When I passed data for the form ...
Karthikesh Pushparaj's user avatar
1 vote
2 answers
565 views

I am using django-jenkins v0.110.0 and coverage v5.2.1 , with Django v3.1. As mentioned in the subject, when I ran: python manage.py jenkins --enable-coverage I get this error: AttributeError: '...
jaysonpryde's user avatar
  • 2,813
1 vote
2 answers
365 views

I've run into the following (edge?) case that I don't know how to handle properly. The general problem is that I have a function that I want to test in that function I call an external function with a ...
Arne's user avatar
  • 20.7k
1 vote
1 answer
1k views

First, sorry for asking again. I found some posts on this topic, but none of the recommendations worked for me. The outcome is well known: PyDev always reports "File has no statistics". In a previous ...
Christoph Jüngling's user avatar
1 vote
1 answer
911 views

I'm trying to exclude some files from a coverage report. I'm using TravisCI and Coveralls.io for test my project. My test code is as follows: script: - cd ../ - nosetests --with-coverage --cover-...
Samuel Góngora's user avatar
1 vote
1 answer
27 views

I want to exclude tests directories, but include one file from the tests directory. Example .coveragerc: [run] omit = */tests/* !*/myapp/tests/my_file.py but I think coverage.py doesn't ...
dfrankow's user avatar
  • 21.7k
1 vote
1 answer
567 views

I'm running pytest with pytest-cov with the following command line: python -m pytest Mytools\tests --junitxml test_reports\unittest_result.xml --cov . --cov-branch --cov-report xml:test_reports\...
Alberto B's user avatar
  • 650
1 vote
1 answer
2k views

I am trying to run pytest with coverage output, using a .coveragerc file. First of all, here is my folder structure: playground/ ├─ excercise.01/ │ ├─ calculator.py │ ├─ test_calculator.py ├─ ....
Lavínia Beghini's user avatar
1 vote
1 answer
1k views

When I run test, code in the "if" block is called and executed. However pytest-coverage marks it as missing(coverage decreases). It's uncovered if I write like this if some_working_condition:...
Zhanara's user avatar
  • 117
1 vote
1 answer
232 views

Well, I trying establish a web page with a wordpress and GoDaddy hosting. I want to make fast web page, because people says fast web pages appear on first line at Google (as specially mobile web page ...
mehmet's user avatar
  • 1,630
1 vote
2 answers
2k views

I want to get the code coverage of a python file say "Test.py". Now, when I write the script for this using coverage.py, it looks like this, import coverage cov = coverage.Coverage() cov.start() #...
JJ_29's user avatar
  • 53
1 vote
2 answers
3k views

Consider the following code: import math def dumb_sqrt(x): result = math.sqrt(x) if x >= 0 else math.sqrt(-x)*j return result def test_dumb_sqrt(): assert dumb_sqrt(9.) == 3. The test ...
wim's user avatar
  • 368k
1 vote
1 answer
523 views

I am doing some coverage analyis on a code base that contains a fair amount of deprecated (using the deprecated package) methods. Most of these deprecated methods do not have any tests. So when doing ...
Ivo Merchiers's user avatar
1 vote
1 answer
3k views

I am using tox to automatically run my tests using pytest and pytest-cov plugin. However, I'm getting coverage reports for the files I omitted in .coveragerc: (env) alex@smartalex-pc:~/.repos/codelib/...
adder's user avatar
  • 3,748
1 vote
1 answer
145 views

I am using coverage to check which unit tests to write. I'm checking in accounts/views.py, for which I haven't written any tests, but why it's not showing tests missing case(i.e in red)? I expect ...
Timer's user avatar
  • 47
1 vote
1 answer
536 views

I am using coverage.py on my code (python 2.7), inside PyDEV on Windows. I have bits of code that run only on UNIX, usually starting with: if os.name == 'posix': and I want to make sure this is ...
ModdyFire's user avatar
  • 826
1 vote
2 answers
3k views

in mac terminal $ coverage help Coverage.py, version 3.5 Measure, collect, and report on code coverage in Python programs. While in the eclipse, I encounter error as follows: please give a hand ...
Jane_Meng's user avatar
  • 759
1 vote
1 answer
1k views

I get an import error when I use coverage.py to run a suite of tests where nose is the underlying test runner. The tests run fine if I just run under Python instead. coverage run run_tests.py ERROR ...
Lorin Hochstein's user avatar
1 vote
1 answer
824 views

Consider the following example file test.py: def fun(l): for i in l: a = 1 print(a) if __name__ == '__main__': fun([1]) Testing branch coverage with coverage erase; coverage run -...
jakun's user avatar
  • 674
1 vote
1 answer
1k views

I am using Azure Databricks, running a python script instead of using Notebooks. Given the way Databricks is implemented, it's hard to test the code in my local machine, so I wanted to create another ...
Lomefin's user avatar
  • 1,261
1 vote
3 answers
2k views

Is there a way to create a Makefile/script that will fail if a file from coverage.py library has values below a certain threshold? Say 80%.
Callum's user avatar
  • 31
1 vote
1 answer
1k views

I am trying to test a function that might crash, using multiprocessing.Process(). The code written below restarts the call if the function doesn't respond ideally within 10 minutes which is working ...
Saransh's user avatar
  • 95
1 vote
1 answer
1k views

I am using Coverage.py package to collect the coverage report. For now, I am collect the coverage report by running two commands like below: venv) ☁ python-codelab [master] ⚡ coverage run /Users/...
Lin Du's user avatar
  • 104k
1 vote
1 answer
2k views

Here's my .coveragerc include = */<project-dir>/* My sample script: echo "Running unit tests along with coverage" coverage run -m pytest echo "printing coverage report" ls -al echo "getting ...
Aqua267's user avatar
  • 953
1 vote
1 answer
710 views

I'm new to Python. I am new to PyCharm. I am trying to debug through my unit tests. They are done with nosetest. Currently, when I run my tests with the vagrant debugger, it gives me the following ...
Christopher Pisz's user avatar
1 vote
1 answer
1k views

To reproduce: Create a project with two services. Test each service in its own container using docker-compose run --rm --entrypoint='pipenv run coverage run […]' [service-name]. Combine the results ...
l0b0's user avatar
  • 59.6k
1 vote
1 answer
271 views

I'm running a nosetests command that results in strange results. See image: for details: folder structure and coverage results Why aren't the files under the customercard_source/objects folder being ...
Ara's user avatar
  • 11
1 vote
1 answer
120 views

I'm supposed to configure a python package with tests and coverage. Now, I can successfully run tests (with nosetest) and coverage (through coverage.py), but I'm a little confused on how to make ...
Liquid's user avatar
  • 243
1 vote
1 answer
367 views

I have test.sh that runs python command on many different scripts. Is there a way to emit coverage -a for each python call without prepending each command with coverage -a?
d33tah's user avatar
  • 11.8k

1
5 6
7
8 9
11