@shibani77/

TemporalTrueVaporware

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import unittest

class UnboundedLocalError(unittest.TestCase):
  def test_foo(self):
    expected = 5
    self.assertEqual(expected, foo())

  def test_bar(self):
    expected = 6
    self.assertEqual(expected, bar())

  def test_bar2(self):
    expected = 9
    self.assertEqual(expected, bar2())

  def test_foo1(self):
    expected = [1, 2, 3, 4]
    self.assertEqual(expected, foo1())

  def test_foo2(self):
    expected = [1, 2, 3, 4]
    self.assertEqual(expected, foo2())



my_var = 5
my_second_var = 8
my_list = [1, 2, 3]

def foo():
  return(my_var)

def bar():
  my_var += 1
  return(my_var)

def bar2():
  global my_second_var
  my_second_var += 1
  return(my_second_var)

def foo1():
  my_list.append(4)
  return my_list

def foo2():
  my_list += [4]
  return my_list



if __name__ == '__main__':
  unittest.main()