# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import random
import tempfile
from unittest import TestCase

import torch

logger = logging.getLogger(__name__)


class ReproducibleTestCase(TestCase):
    # Directory where everything temporary and test-related is written
    test_dir = tempfile.mkdtemp()

    def setUp(self):
        logging.basicConfig(format=("%(asctime)s - %(levelname)s - "
                                    "%(name)s - %(message)s"),
                            level=logging.INFO)
        seed = 0
        torch.manual_seed(seed)
        if torch.cuda.is_available():
            torch.cuda.manual_seed(seed)
        random.seed(0)

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import random
import tempfile
from unittest import TestCase

import torch

logger = logging.getLogger(__name__)


class ReproducibleTestCase(TestCase):
    # Directory where everything temporary and test-related is written
    test_dir = tempfile.mkdtemp()

    def setUp(self):
        logging.basicConfig(format=("%(asctime)s - %(levelname)s - "
                                    "%(name)s - %(message)s"),
                            level=logging.INFO)
        seed = 0
        torch.manual_seed(seed)
        if torch.cuda.is_available():
            torch.cuda.manual_seed(seed)
        random.seed(0)

# -*- coding: utf-8 -*- # Directory where everything temporary and test-related is written