Metadata-Version: 2.4
Name: codorectorate
Version: 0.0.1
Summary: Uses decorators to print comments before function invocation
Author-email: Even Stensberg <evenstensberg@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Even Stensberg <evenstensberg@gmail.com>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/evenstensberg/comment-decorator
Project-URL: Issues, https://github.com/evenstensberg/comment-decorator/issues
Keywords: decorator,pip,package
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Codorectorate

Simple util module that makes it possible to use decorators to comment before a function or method is run. Useful in E2E testing using Selenium or just normally when running code that should be manually verified to run.

## Example - simple

```python
from codorectorate import comment

@comment("Hello")
def test(arg):
    print("world")
```

## Example - in tests

```python
import os
import time
import requests
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from http import HTTPStatus

def comment(argument):
    def decorator(function):
        def wrapper(*args, **kwargs):
            print(argument)
            result = function(*args, **kwargs)
            return result
        return wrapper
    return decorator

class TestNavigationTabs(StaticLiveServerTestCase):
    def setUp(self):
        options = Options()
        IS_CI = os.environ.get('CI')
        if IS_CI:
            print("Running Acceptance Test in headless mode because of CI")
            options.add_argument("--headless")
        self.browser = webdriver.Chrome(options=options)

    def tearDown(self):
        self.browser.quit()

    @comment("Selenium doesnt expose status code in their API")
    def test_404(self):
        url = f'{self.live_server_url}/nosuchurl/'
        self.browser.get(url)
        response = requests.head(url)
        self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
        
```
## Publishing

1. `python3 -m build`
2. `twine upload dist/*`

> `pip3 install comment-decorator`
