New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#213 set maximum build count to display in the archives section #214
Conversation
Codecov Report
@@ Coverage Diff @@
## master #214 +/- ##
=============================================
- Coverage 26.976% 26.546% -0.431%
=============================================
Files 6 6
Lines 645 663 +18
=============================================
+ Hits 174 176 +2
- Misses 471 487 +16 |
note: will fix the issues mentioned in linter |
note: will add unit test for this module |
c26e88c
to
96b5b9d
Compare
class HTMLReporter(object): | ||
def __init__(self, path, config): | ||
def __init__(self, path, archive_count, config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do in this way?
- Archive count make as a command line option with some default
- During HTMLReporter init just take the cmd param value and set this as the archive_count attribute value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Archive count make as a command line option with some default
- Yeah I already have that snippet in
pytest_addoption
method
group.addoption(
"--archive-count",
action="store",
dest="archive_count",
default="",
help="set maximum build count to display in the archives section",
)
During HTMLReporter init just take the cmd param value and set this as the archive_count attribute value?
- I think I did the same - not sure if I am right. can you please give me the snippet as a rough idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually set empty string as default purposely; cos, we allow archives by default.
pytest_html_reporter/util.py
Outdated
|
||
|
||
def remove_old_archives(path, archive_count): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it's better to make this function as HTMLReporter class method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kozakHolota moved inside the HTMLReporter
96b5b9d
to
b290fbe
Compare
Merge checklist