Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-69714: Makecalendar module fully tested#93655

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ambv merged 29 commits intopython:mainfrombxsx:gh-69714/calendar-test-coverage
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
29 commits
Select commitHold shift + click to select a range
cb0523e
Increased test coverage of calendar module
rohitmedirattaNov 1, 2015
78935da
gh-69714: Restore the test thrown out by cb0523e67c
bxsxJun 6, 2022
0dd6321
gh-69714: Increase test coverage for `calendar.Locale{Text|HTML}Calen…
bxsxJun 6, 2022
69c8f4f
gh-69714: Add missing test cases for custom locale in `calendar.Local…
bxsxJun 7, 2022
a96786c
gh-69714: Remove unreachable code (and increase test coverage)
bxsxJun 7, 2022
636b4e1
gh-69714: Increase CLI tests coverage
bxsxJun 9, 2022
238c527
gh-69714: Add more test cases to `calendar` cmdline
bxsxJun 9, 2022
b850c92
gh-69714: Increase test coverage for `calendar` cmdline
bxsxJun 9, 2022
ab069a4
gh-57539: Add tests for `LocaleTextCalendar.formatweekday`
jesstessApr 27, 2014
f1febfc
gh-69714: Increase test coverage for `LocaleTextCalendar.formatmonthn…
bxsxJun 9, 2022
e9e8825
Merge branch 'main' into gh-69714/calendar-test-coverage
bxsxJun 9, 2022
827e664
Remove comment
bxsxJun 9, 2022
d28e2e4
gh-69714: Reorder locale in the test case
bxsxJun 9, 2022
bbdc393
gh-69714: Extract test case
bxsxJun 9, 2022
8914cdc
Update ACKS
bxsxJun 9, 2022
68adf69
Add NEWS entry
bxsxJun 9, 2022
40e0da3
Revert "gh-69714: Remove unreachable code (and increase test coverage)"
bxsxJun 9, 2022
2b6f1f9
Expand the try clause to calls to `LocaleTextCalendar.formatmonthname…
bxsxJun 9, 2022
64cb029
Revert "Revert "gh-69714: Remove unreachable code (and increase test …
bxsxJun 9, 2022
2b2c8ef
Add missing whitespace
bxsxJun 10, 2022
8b7bc06
gh-69714: Move the validation to the beginning of the function
bxsxJun 11, 2022
de21a51
gh-69714: Increase test coverage for illegal arguments
bxsxJun 11, 2022
ab5a508
Revert "gh-69714: Add more test cases to `calendar` cmdline"
bxsxJun 11, 2022
1558845
Clean up redundant arguments
bxsxJun 11, 2022
0aa0caf
gh-69417: Include cases with odd widths in `formatmonthname`
bxsxJun 11, 2022
e73fc9e
gh-69714: Split tests for LocaleTextCalendar and LocaleHTMLCalendar
bxsxJun 11, 2022
5b094ae
Merge branch 'main' into gh-69714/calendar-test-coverage
iritkatrielFeb 18, 2023
87feac0
Merge branch 'main' into gh-69714/calendar-test-coverage
bxsxJul 20, 2023
81d09b2
Merge branch 'main' into gh-69714/calendar-test-coverage
bxsxJul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletionsLib/calendar.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -585,8 +585,6 @@ def __enter__(self):
_locale.setlocale(_locale.LC_TIME, self.locale)

def __exit__(self, *args):
if self.oldlocale is None:
return
_locale.setlocale(_locale.LC_TIME, self.oldlocale)


Expand DownExpand Up@@ -690,7 +688,7 @@ def timegm(tuple):
return seconds


def main(args):
def main(args=None):
import argparse
parser = argparse.ArgumentParser()
textgroup = parser.add_argument_group('text only arguments')
Expand DownExpand Up@@ -747,7 +745,7 @@ def main(args):
help="month number (1-12, text only)"
)

options = parser.parse_args(args[1:])
options = parser.parse_args(args)

if options.locale and not options.encoding:
parser.error("if --locale is specified --encoding is required")
Expand All@@ -756,6 +754,9 @@ def main(args):
locale = options.locale, options.encoding

if options.type == "html":
if options.month:
parser.error("incorrect number of arguments")
sys.exit(1)
if options.locale:
cal = LocaleHTMLCalendar(locale=locale)
else:
Expand All@@ -767,11 +768,8 @@ def main(args):
write = sys.stdout.buffer.write
if options.year is None:
write(cal.formatyearpage(datetime.date.today().year, **optdict))
elif options.month is None:
write(cal.formatyearpage(options.year, **optdict))
else:
parser.error("incorrect number of arguments")
sys.exit(1)
write(cal.formatyearpage(options.year, **optdict))
else:
if options.locale:
cal = LocaleTextCalendar(locale=locale)
Expand All@@ -795,4 +793,4 @@ def main(args):


if __name__ == "__main__":
main(sys.argv)
main()
Loading

[8]ページ先頭

©2009-2025 Movatter.jp