How to use the aiosmtpd.__file__ function in aiosmtpd

To help you get started, we’ve selected a few aiosmtpd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / aiosmtpd / aiosmtpd / testing / nose.py View on Github external
"""nose2 test infrastructure."""

import os
import re
import doctest
import logging
import aiosmtpd

from contextlib import ExitStack
from nose2.events import Plugin

DOT = '.'
FLAGS = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | doctest.REPORT_NDIFF
TOPDIR = os.path.dirname(aiosmtpd.__file__)


def setup(testobj):
    testobj.globs['resources'] = ExitStack()


def teardown(testobj):
    testobj.globs['resources'].close()


class NosePlugin(Plugin):
    configSection = 'aiosmtpd'

    def __init__(self):
        super(NosePlugin, self).__init__()
        self.patterns = []