semvec/pypi-packages huggingface dataset:
soft-assert 1.0.5
Soft assertions for Python/Pytest

# soft-asserts
Soft assertions for Python/Pytest

## Installation

```bash
pip install soft-assert
```
## Usage

Assertion is performed immediately after the call `check()`, 
but the expected result is obtained only after exit the context manager `verify()`

Quick example:
```python
from  soft_assert import check, verify

def test_something():
    with verify():
        check(1 == 1)
        check(2 > 1, 'Message if test failed')
        check('one' != 'two', 'Some message')
```

You can use asserts in loop:
```python
from  soft_assert import check, verify

def test_asserts_in_loop():
    with verify():
        for number in range(1, 10):
            check(number % 2 == 0, '{number} is not a multiple of 2')
```

Also you can use it with pytest parametrized tests:
```python
import pytest
from  soft_assert import check, verify

@pytest.mark.parametrize('number', list(range(1, 10)))
def test_pytest_example(number):
    with verify():
        check(number % 2 == 0)
```

Example of output:
```python
AssertionError: Failed conditions count: [ 4 ]

1. Failure: Custom message if test failed

2. Failure: Lists not equals

3. Failure: Your custom message; 4 < 5!

4. Failure: one != two
```

More examples you can find in `test_example.py`
print-position 2.0.1
A cool python package to add the timestamp, line number and file name in the print statements.
Requires Python: >=3.6

# Print Position

A cool python package to add the timestamp, file name and line number in the print statements. This small tool can be very helpful in debugging big Python projects.

[Here](https://pypi.org/project/print-position/) is the project on pypi.

The current download stas are:
[![Downloads](https://static.pepy.tech/badge/print-position)](https://pepy.tech/project/print-position)
[![Downloads](https://static.pepy.tech/badge/print-position/month)](https://pepy.tech/project/print-position)


## Motivation

To debug the Python code present in multiple files, it becomes difficult to track down the print statement calls in the different files. This small pip package can be highly useful in such cases, one can simply use the custom print statement defined in this package and see the filename and line number of the print calls.

## How to install?

Just install the package using the command:

```
pip3 install print-position
```


## Usage


Simply add this import statement on top of your python file to see the time, file name and line number of each print statement.

```
from print_position import print_pos as print
```

A simple example is (test_pos.py):

```
from print_position import print_pos as print
print("Test on line 2 from test.py")
print("Test on line 3 from test.py")

print("Test on line 7 from test.py")
```

The output is shown as:
```
@file_name:line_number
print_data
```


If you want to also see the timestamp, just use the print_pos_time function like this:

```
from print_position import print_pos_time as print
```

A simple example is (test_pos_time.py):

```
from print_position import print_pos_time as print
print("Test on line 2 from test.py")
print("Test on line 3 from test.py")

print("Test on line 7 from test.py")
```


The output is shown as:
```
time:@file_name:line_number
print_data
```



I believe this would be very helpful in tracking down errors during debugging, **especially when you are working with someone else's code**.

## Changelog
### 2.0.1: 
- Added another function to print the time of the print call.
- Restructured the project to improve imports.


# Contact me

To raise any **issues/requests** you may refer the issue page [here](https://github.com/ps428/PrintPosition-pip/issues).

You may **mail me** here on my [mail id](mailto:pranav.bhawan@gmail.com).

Feel free to **connect with me** on [my LinkedIn](https://www.linkedin.com/in/ps428).

Please do check out my other projects on my **GitHub** [here](http://www.github.com/ps428).

Also I have made many cool Firefox Add ons. They are pretty useful, you may want to check them out [here](https://addons.mozilla.org/en-US/firefox/user/17277929/).

If you like my work, you may want to [buy me a book here](https://www.buymeacoffee.com/ps428).