1. Summary
----------

I don't understand, how I can run Python method after another actions.

---

2. File
-------

Example of my `.py` file:

```python
# First test
for filename in first_folder:

    if "Sasha Great" in open(filename).read():
        log.debug(filename + " Done")
    else:
        print("First test failure for " + filename)

```

---

3. Expected algoritm
--------------------

### 3.1. Tests passed

**If** all tests passed, print to console:

```python
Test for all files successful passed

```

### 3.2. Tests failed

**If**, for example, one of my tests failure for `SashaExample.txt`:

1. print `First test failure for SashaExample.txt`;
2. continue first test for another files;
	1. **if** there are more errors as `First test failure for AnotherExample.txt`, print errors to console and continue test;
3. `exit(1)` after running all tests.

I need `exit(1)`, that I can see, that I have errors in my tests, if I use Travis CI or AppVeyor.

---

4. Not helped
-------------

### 4.1. exit(1) after else

**If**:

```python
for filename in first_folder:

    if "Sasha Great" in open(filename).read():
        log.debug(filename + " Done")
    else:
        print("First test failure for " + filename)
        exit(1)

```

Program end after first error. But I need to see all errors.

### 4.2. Another attempts

1. I don't find, how I can solve my problem, in Google;
2. I read about Python functions, methods, [**`atexit`**](https://docs.python.org/3/library/atexit.html), but I don't understand, how I can solve this problem.