Commit Graph

28 Commits

Author SHA1 Message Date
François Freitag
341b98f794
linkcheck: Rewrite auth tests without mocking
Makes the test more realistic by issuing an HTTP request.
Reduces coupling between test and the code under test.
2020-11-11 21:22:59 +01:00
François Freitag
53ca608bc0
linkcheck: Test redirect following for HEAD and GET 2020-11-11 18:32:53 +01:00
François Freitag
6ea0a123c6
Rename test-linkcheck-localserver{,-anchor}
Precise the `linkcheck_anchors` option is enabled. Frees the name
`test-linkcheck-localserver` for future tests without that option.
2020-11-11 18:32:52 +01:00
Takeshi KOMIYA
386929ec0f
Merge pull request #8409 from francoisfreitag/linkcheck-tests
linkcheck: Remove unused arguments from tests
2020-11-12 02:17:52 +09:00
François Freitag
c90eef1f67
linkcheck: Remove unused arguments from tests 2020-11-11 13:48:45 +01:00
François Freitag
0949735210
Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.

The isort project has more feature and is more active than the
flake8-import-order plugin.

Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
2020-11-11 13:19:05 +01:00
François Freitag
0178437f3c
Rewrite test_inspect_main_url to avoid mocking
Makes the test more realistic by issuing an HTTP request.
Reduces coupling between test and the code under test.

The `http_server` helper was factored out into a new tests.utils module.
2020-11-08 22:30:49 +01:00
François Freitag
5ea8ee133d
Fix #8268: make linkcheck report HTTP errors 2020-10-03 14:33:29 +02:00
Takeshi KOMIYA
f95ba21f4a Close #5208: linkcheck: Support checks for local links 2020-07-19 19:08:14 +09:00
Takeshi KOMIYA
a7725ad8ca Close #7247: linkcheck: Add linkcheck_request_headers 2020-06-01 01:48:46 +09:00
Takeshi KOMIYA
95b98d97d5 test: clean up 2020-03-01 17:44:10 +09:00
Wes Turner
fd94270f1c ENH: linkcheck: also write all links to output.json
* TST: linkcheck: make tests more flexible
* CLN: linkcheck: flake8, mypy
* REF: linkcheck: docpath->filename, write_jsonline->write_linkstat
* REF: linkcheck: remove redundant call to doc2path
* TST: linkcheck: show JSON obj structure in test
* REF: linkcheck: remove docname from JSON obj because it's redundant (use path2doc(filename) if necessary)
* TST: linkcheck: don't test row[info] output (see comments for examples)
2020-02-12 16:29:26 -05:00
Takeshi KOMIYA
4dd8b1022f test: Use read_text() and read_bytes() 2020-02-01 11:58:51 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Jonas Haag
df2f80c755 Add linkcheck_auth option 2019-11-25 09:53:45 +01:00
Takeshi KOMIYA
9b2c1c679a Fix #6444: test: replace example.com by existing page 2019-06-05 23:42:24 +09:00
Takeshi KOMIYA
f551915e9f Close #5196: linkcheck also checks remote images exist 2019-02-06 00:21:52 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Takeshi KOMIYA
b56f4f9022 Remove print_function feature 2018-12-15 23:16:10 +09:00
Timotheus Kampik
f605012617 #4886 remove obsolete * 2018-07-17 20:40:49 +02:00
Timotheus Kampik
c126067f4e #4886 add tests
to better cover the current link check ignore configuration
 behavior
2018-07-16 23:17:44 +02:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
shimizukawa
baaef9146d pytest: remove deprecated with_app decorator functions 2017-01-06 01:14:47 +09:00
Darragh Bailey
22765990f0 Allow skipping anchor checking by regex
To avoid needing to turn off anchor checking across the entire
documentation allow skipping based on matching the anchor against a
regex.

Some sites/pages use JavaScript to perform anchor assignment in a
webpage, which would require rendering the page to determine whether
the anchor exists. Allow fine grain control of whether the anchor is
checked based on pattern matching, until such stage as the retrieved
URLs can be passed through an engine for deeper checking on the HTML
doctree.
2016-10-27 10:52:04 +01:00
Hiroaki Itoh
42604a1ff6 Fix #2990: linkcheck raises "Can't convert 'bytes' object to str implicitly" error if linkcheck_anchors enabled 2016-10-06 18:59:24 +09:00