Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7628583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:36:57+00:00 2026-05-31T05:36:57+00:00

I’ve configured it so my simple unit test passes. But nosexunit.xml is reporting on

  • 0

I’ve configured it so my simple unit test passes. But nosexunit.xml is reporting on test lib files. Partial output:

nosexcover-1.0.7-py2.6.egg/nosexcover/nosexcover    25     24     4%   5-41, 46-56
test/unit/test_setup                                13      0   100%   

The project is split up into different modules that need to be tested independently. I’m focusing on the backend module at present. I want to restrict coverage to the lib package. A sample of the project tree:

project
\-- backend     # <-- module I'm testing
    \-- lib     # <-- what I want to cover
    \-- test
       \-- unit/test_setup.py       # <-- test I'm running
    \-- setup.py
    \-- setup.cfg
\--reporting
    \-- setup.py
    \-- setup.cfg

I’m running the tests from the dir named backend:

project/backend$ python setup.py nosetests -s --tests=unit/test_setup.py

Nosetests is configured in setup.cfg as follows

[nosetests]
# locating tests
where=./test
include=^unit.*

# coverage
cover-package=lib
cover-html=1
cover-html-dir=htmlcov
with-xcoverage=1
xcoverage-file=coverage.xml
with-xunit=1
xunit-file=nosexunit.xml
cover-erase=1

I’ve got a feeling one of the path settings is off. I’m assuming the where and cover-package settings are relative to the location of setup.py (also where I’m running the test) and include is relative to where.

Nosetests documentation wasn’t much help. I hope someone can set me straight here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:36:58+00:00Added an answer on May 31, 2026 at 5:36 am

    It turns out that I had this configured correctly after all. The problem seems to be that, for my overly simplified smoke test, I wasn’t actually importing anything from the module to which I restricted coverage.

    Apparently, in this case, when coverage is nil, rather than report that boring fact, nosexcoverage or nosetests decides to give you a coverage report about a bunch of other stuff instead.

    By adding an import statement for the module I wanted covered, I got the proper coverage report:

    ----------------------------------------------------------------------
    XML: nosexunit.xml
    Name        Stmts   Miss  Cover   Missing
    -----------------------------------------
    lib             0      0   100%   
    lib.blank       1      0   100%   
    -----------------------------------------
    TOTAL           1      0   100%   
    ----------------------------------------------------------------------
    Ran 2 tests in 0.008s
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.