for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import unittest
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
from foil.formatters import format_repr, format_repr_info
class Klass:
def __init__(self, z, y):
self.z = z
z
[a-z_][a-z0-9_]{2,30}$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
self.y = y
y
class TestObjectReprFormatters(unittest.TestCase):
def setUp(self):
self.obj = Klass('hello', 10)
self.attributes = ['z', 'y']
def test_format_repr(self):
result = format_repr(self.obj, self.attributes)
expected = "Klass(z='hello', y=10)"
self.assertEqual(expected, result)
def test_format_repr_info(self):
result = format_repr_info(self.obj, self.attributes)
expected = "<Klass(z='hello', y=10)>"
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.