| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -1068,6 +1068,7 @@ def test_several_leapyears_in_range(self): | |
| def conv(s): | ||
| return s.replace('\n', os.linesep).encode() | ||
|
|
||
| @support.force_not_colorized_test_class | ||
| class CommandLineTestCase(unittest.TestCase): | ||
| def setUp(self): | ||
| self.runners = [self.run_cli_ok, self.run_cmd_ok] | ||
| Expand Down Expand Up | @@ -1121,7 +1122,6 @@ def assertFailure(self, *args): | |
| self.assertCLIFails(*args) | ||
| self.assertCmdFails(*args) | ||
|
|
||
| @support.force_not_colorized | ||
| def test_help(self): | ||
| stdout = self.run_cmd_ok('-h') | ||
| self.assertIn(b'usage:', stdout) | ||
| Expand Down Expand Up | @@ -1256,6 +1256,15 @@ def test_html_output_year_css(self): | |
| self.assertIn(b'<link rel="stylesheet" href="custom.css">', output) | ||
|
|
||
|
|
||
| @support.force_colorized_test_class | ||
| class ColorTestCase(unittest.TestCase): | ||
| def test_formatmonth_color(self): | ||
| today = datetime.date(2026, 5, 4) | ||
| cal = calendar._CLIDemoCalendar(highlight_day=today) | ||
| output = cal.formatmonth(2026, 5) | ||
| self.assertIn("\x1b[30m\x1b[43mMay 2026\x1b[0m\n\x1b[36m", output) | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityHmm, do we support running tests with different themes? If a user has a custom theme this test will fail.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWe don't support running tests with different themes. Other tests could also break if the user changed the theme: ❯ rg "x1b" Lib/test/test_*.py -l | wc -l
13Right now the theme API is internal/private. If we make it public in a later release, we'll need to consider tests are with the default theme or a specific theme.
Sorry, something went wrong.
StanFromIreland reacted with thumbs up emoji
All reactions
|
||
|
|
||
|
|
||
| class MiscTestCase(unittest.TestCase): | ||
| def test__all__(self): | ||
| not_exported = { | ||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add more color to :mod:`calendar`'s CLI output. Patch by Hugo van Kemenade. |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.