@@ -8,7 +8,7 @@ Advanced usage
88Automated tests
99---------------
1010
11- You can also execute `pep8 ` tests from Python code. For example, this
11+ You can also execute `` pep8 ` ` tests from Python code. For example, this
1212can be highly useful for automated testing of coding style conformance
1313in your project::
1414
@@ -25,7 +25,7 @@ in your project::
2525 self.assertEqual(result.total_errors, 0,
2626 "Found code style errors (and warnings).")
2727
28- If you are using `nosetests ` for running tests, remove `quiet=True `
28+ If you are using `` nosetests `` for running tests, remove `` quiet=True ` `
2929since Nose suppresses stdout.
3030
3131There's also a shortcut for checking a single file::
@@ -38,6 +38,23 @@ There's also a shortcut for checking a single file::
3838 print("Found %s errors (and warnings)" % file_errors)
3939
4040
41+ Configuring tests
42+ .................
43+
44+ You can configure automated ``pep8 `` tests in a variety of ways.
45+
46+ For example, you can pass in a path to a configuration file that ``pep8 ``
47+ should use::
48+
49+ import pep8
50+
51+ pep8style = pep8.StyleGuide(config_file='/path/to/tox.ini')
52+
53+ You can also set specific options explicitly::
54+
55+ pep8style = pep8.StyleGuide(ignore=['E501'])
56+
57+
4158Skip file header
4259----------------
4360
@@ -46,7 +63,6 @@ Another example is related to the `feature request #143
4663at the beginning and the end of a file. This use case is easy to implement
4764through a custom wrapper for the PEP 8 library::
4865
49- #!python
5066 import pep8
5167
5268 LINES_SLICE = slice(14, -20)
0 commit comments